#ifndef __GAF_RUNBASE_H__
#define __GAF_RUNBASE_H__


namespace GAF
{
	class Runnable;
	class RunBase;
}
typedef GAF::Runnable			GAF_IRunnable;
typedef GAF::RunBase			GAF_CRunBase;

#include "GAF_Define.h"

namespace GAF
{
	/// 计时对象响应接口
	class _INTERFACE Runnable
	{
	public:
		/// 当响应时
		/**
		 *  @returns
		 *	返回是否继续。
		 */
		virtual void		OnRun(GAF_CRunBase* pRunBase) = 0;
	};

	/// 计时对象基类
	class _ABSTRACT RunBase
	{
	public:
		RunBase() :
			ATTRIB(Interval)(40),
			ATTRIB(RunClass)(NULL)
		{}
		
		virtual ~RunBase(){}

	public:
		/// 响应时间属性
		DIM_ATTRIB(TimeTicks, Interval);
		/// 响应对象属性
		DIM_ATTRIB(Runnable*, RunClass);
	};
}

#endif
